import re
formatString1="%-22s:%s"
testString1=\
              "Albert Antstein,phone:123-4567,e-mail:albert@bug2bug.com"
expression1=\
              r"(\w+ w+),phone:(\d{3}-\d{4}),email:(\w+@w+\.\w{3})"
print(formatString1 % ("Original string",re.match(expression1,testString1).group()))
print(formatString1 % ("Original string",re.match(expression1,testString1).group(3)))
print
formatString2="%-38s:%s"
pathstring="/books/2001/python"
expression2="(/.+)/"
print(formatString1%("greedy error",re.match(expression2,pathstring).group(1))
expression3="(/.+?)/"
print(formatString1 % ("non error,base only",re.match(expression3,pathstring).group(1)))     

